package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        String []str={"one","two","three","four","five"};
        for (int i=0;i< str.length;i++){
            System.out.println(str[i]);
        }
        for (String str3:str){
            System.out.println(str3);
        }
        Collection c =new  ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        Iterator it=c.iterator();
        while (it.hasNext()){
            String str1=(String) it.next();
            System.out.println(str1);
            for (Object obj:c){
                System.out.println(obj);
            }
        }
    }
}
